//
//  RedDotView.swift
//  Trans
//
//  Created by zcj on 2024/11/6.
//

import SwiftUI

struct RedDotView: View {
    @Binding var count:Int
    @ObservedObject var arr = KzMutableArray<FileTransMessage>(array: [])
    var body: some View {
        ZStack{
           
            Image(systemName: "square.and.arrow.up.circle.fill")
            if( arr.array.count - count > 0){
                Circle()
                    .fill(.red)
                    .frame(width: 20, height: 20)
                    .overlay(
                        Text("\(arr.array.count - count)")
                            .font(.system(size: 12))
                            .foregroundColor(.white)
                    )
                    .offset(x: -10, y: -10)
            }
        }
        
    }
    
}

#Preview {
    RedDotView(count: .constant(0))
}
